
#include <stdio.h>
int main()
{
  int n;
  scanf("%d", &n);

  int arr[n];

  for (int i = 0; i < n; i++)
  {
    scanf("%d", &arr[i]);
  }

  int j;
  int t;
  for (int i = 1; i < n; i++)
  {
    t = arr[i];
    j = i - 1;
    while (j >= 0 && arr[j] > t)
    {
      arr[j + 1] = arr[j];
      j--;
    }
    arr[j + 1] = t;

    for (int k = 0; k < n; k++)
    {
      printf("%d ", arr[k]);
    }
    printf("\n");
  }
}
